﻿@{
    ViewBag.Title = "Варианты продуктов";
}
@section style
{
    <link rel="stylesheet" href="~/static/plugins/jui/css/ui-lightness/jquery-ui-1.10.3.custom.min.css">
    <link rel="stylesheet" href="~/static/plugins/jtable/themes/lightcolor/blue/jtable.min.css">
}
@section script_bottom
{
    <script type="text/javascript" src="~/static/plugins/jui/js/jquery-ui-1.10.3.custom.min.js"></script>
    <script type="text/javascript" src="~/static/plugins/jtable/jquery.jtable.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#TableContainer').jtable({
                title: 'Свойства продуктов',
                actions: {
                    listAction: '@Url.Action("ListVariant")',
                    createAction: '@Url.Action("AddVariant")',
                    updateAction: '@Url.Action("UpdateVariant")',
                    deleteAction: '@Url.Action("RemoveVariant")'
                },
                fields: {
                    Id: {
                        key: true,
                        list: false
                    },
                    Name: {
                        title: 'Имя'
                    }
                }
            });
            $('#TableContainer').jtable('load');
        });
    </script>
}

<h2>Варианты продуктов</h2>
<div id="TableContainer"></div>
